package com.sys.Utils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSONObject;


public class InputUtils {

	public static List<JSONObject> inputData(String fileName) throws IOException{
		List<JSONObject> list = new ArrayList<JSONObject>();
		File file = new File(fileName);
		if(!file.isFile()){
			System.out.println(fileName+"文件不存在！");
			return null;
		}
		Reader reader = new InputStreamReader(new FileInputStream(file));
		BufferedReader br = new BufferedReader(reader);
		String readLine =null;
		while((readLine= br.readLine())!=null){
			JSONObject obj = JSONObject.parseObject(readLine);
			list.add(obj);
		}
			
		br.close();
		return list;
		
	}
}
